class ModalStore {
	open: boolean
	update_store: any = {}

	constructor(open: boolean) {
		this.open = open
	}

	getDetail = () => ({
		open: this.open,
		setModal: this.setModal,
		setUpdateFunc: this.setUpdateFunc
	})

	// 设置更新方法
	setUpdateFunc = (onChange: any) => {
		this.update_store.update = onChange
	}

	setModal = (open: boolean) => {
		this.open = open
		this.update_store.update && this.update_store.update()
	}
}

export default ModalStore
